<?php
$baseUrl = Yii::app()->baseUrl; 
$cs = Yii::app()->getClientScript();
$cs->registerScriptFile($baseUrl.'/js/jquery.min.js');
$cs->registerScriptFile($baseUrl.'/js/setting_preference.js');
?>
<!-- Preferences Tab -->
<div class="section settings_currency">
<h2>Currency</h2>
<form class="form" id="currency_form">
<ol>
	<li style="display: list-item;" id="default_currency_li" class="hidden"><label>Default
	Output Currency</label> <select name="default_currency" id="default_currency"
		class="short qtip editable">
        <?php foreach ($currencies as $currency):?>
        <option value="<?php echo $currency['Id']?>"><?php echo $currency['CurrencyName'];?></option>
        <?php endforeach;?>
	</select></li>
	<li><label>Cash Conversion Surcharge</label> <select
		id="surchargeAmount" name="surchargeAmount" onchange="saveSurchargeSetting();" class="short">
		<option value="0" selected="selected">0.0%</option>
		<option value="1">1.0%</option>
		<option value="2">2.0%</option>
		<option value="3">3.0%</option>
		<option value="4">4.0%</option>
		<option value="5">5.0%</option>
		<option value="6">6.0%</option>
		<option value="7">7.0%</option>
		<option value="8">8.0%</option>
		<option value="9">9.0%</option>
		<option value="10">10.0%</option>

	</select> <a id="settings_surcharge" class="help_link qtip"
		target="_blank" href="#currency"></a></li>
</ol>
</form>
</div>

<div class="section">
<h2>Units</h2>
<br>
<h3>Distance</h3>
<form class="form" id="distance_form">
<ol>
	<li><label for="default_mileageRate">Rate per Mile</label> <input
		value="0.565" id="default_mileageRate" name="default_mileageRate" class="editable short"
		type="text"></li>
	<li><label for="default_kmRate">Rate per Kilometer</label> <input
		value="0.351" id="default_kmRate"  name="default_kmRate" class="editable short" type="text">
	</li>
	<li><label for="default_distanceUnit">Default Unit</label> <select
		id="default_distanceUnit" name="default_distanceUnit" class="short">
		<?php foreach ($units as $unit):?>
		<option value="<?php echo $unit['Id']?>"><?php echo $unit['UnitName'];?></option>
		<?php endforeach;?>
	</select></li>
</ol>
</form>
<br>
<h3 id="settings_time_header">Time</h3>
<form class="form" id="time_form">
<ol>
	<li id="default_mileageRate_li"><label for="default_hourlyRate">Default
	Hourly Rate</label> <input value="0" id="default_hourlyRate" name="default_hourlyRate"
		class="editable short" type="text"></li>
</ol>
</form>

</div>

<div class="section last">
<h2>Email Preferences <a id="settings_emailPrefs" class="help_link qtip"
	target="_blank" href="#settings#email"></a></h2>
<form class="form labels-auto" id="email_form">
<ol>
	<li><input name="email_reminders" id="email_reminders" value="true" type="checkbox"> <label
		for="email_reminders">Yes, email me notifications of report
	submissions, approvals, rejections, and forwards.</label></li>
	<li><input name="email_onReportSubmitOrForward" id="email_onReportSubmitOrForward" value="true"
		type="checkbox"> <label for="email_onReportSubmitOrForward">Yes, send
	me a copy of all reports I submit or forward.</label></li>
	<li><input checked="checked" name="subscribed" id="subscribed" value="true"
		type="checkbox"> <label for="subscribed">Yes, you can email me with
	occasional updates and other information.</label></li>
</ol>
</form>

</div>
<div class="button button_update add" id="btn_update"><a>Update</a></div>
<div class="button qtip add">
<a href="#" class="reset" id="btn_reset">Reset</a>
</div>
<img src="/expense/images/spinner_2x.gif" alt="uploading" id="spinter-update" class="hide">

